import Vue from 'vue'
import Router from 'vue-router'
import routes from './routes'
Vue.use(Router)

// export default new Router({
//   // mode: 'hash',
//   mode: 'history',
//   routes: routes
// })
const router = new Router({
  mode: 'history',
  routes,
  scrollBehavior (to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return {x: 0, y: 0}
    }
  }
})
export default router
